<template>
  <view class="container">
    <!-- 搜索框 -->
    <view class="search-container">
      <view class="search-box">
        <text class="search-icon">🔍</text>
        <input type="text" placeholder="搜索分类或商品" />
      </view>
    </view>

    <!-- 分类区域 -->
    <view class="category-container">
      <!-- 分类项（8个，每行4个） -->
      <view class="category-item" v-for="i in 8" :key="i">
        <view class="category-icon">
          <image mode="aspectFit"></image>
        </view>
        <text class="category-name">分类{{i}}</text>
      </view>
    </view>
  </view>
</template>

<style scoped>
/* 基础容器 */
.container {
  width: 100%;
  box-sizing: border-box;
  background-color: #f5f5f5;
  min-height: 100vh;
}

/* 搜索框样式 */
.search-container {
  padding: 16rpx 20rpx;
  background-color: #fff;
}
.search-box {
  display: flex;
  align-items: center;
  background-color: #f2f2f2;
  border-radius: 36rpx;
  padding: 12rpx 20rpx;
}
.search-icon {
  color: #999;
  font-size: 28rpx;
  margin-right: 12rpx;
}
.search-box input {
  flex: 1;
  font-size: 26rpx;
  color: #333;
  height: 40rpx;
}

/* 分类区域样式 */
.category-container {
  display: flex;
  flex-wrap: wrap;
  padding: 20rpx;
  background-color: #fff;
  margin: 16rpx 20rpx;
  border-radius: 16rpx;
}
.category-item {
  width: 25%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24rpx;
}
.category-icon {
  width: 100rpx;
  height: 100rpx;
  background-color: #f8f8f8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8rpx;
}
.category-icon image {
  width: 60rpx;
  height: 60rpx;
}
.category-name {
  font-size: 24rpx;
  color: #333;
}
</style>